﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Hangjing.Model;
using Hangjing.SQLServerDAL;
using Hangjing.Common;
using System.Text;
using Hangjing.WebCommon;

/// <summary>
/// 商家充值配置 
/// </summary>
public partial class App_getRechargeConfig : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Clear();

        StringBuilder shoplistjson = new StringBuilder();
        int shopid = HjNetHelper.GetPostParam("shopid", 0);//商家编号，获取城市编号;

        PointsInfo shop = new Points().GetModel(shopid);

        //todo 根据商家编号，获取此城市的备注

        IList<ordersourcesInfo> list = CacheHelper.GetOrderSourceList();

        shoplistjson.Append("{\"page\":\"1\",\"total\":\"" + 1+ "\",\"datalist\":[");

        ordersourcesInfo info = null;

        bool openAward = true;

        for (int i = 0; i < list.Count; i++)
        {
            info = new ordersourcesInfo();
            info = list[i];

            int award = 0;
            if (openAward)
            {
                award = info.Status;
            }


            shoplistjson.Append("{\"id\":\"" + info.ID + "\",\"money\":\"" + info.classname + "\",\"award\":\"" + award + "\"},");
        }

        shoplistjson.Append("]}");

        Response.Write(shoplistjson.ToString().Replace(",]}", "]}"));
        Response.End();

    }
}

